﻿package group.lv2;

import group.receiver.MessageReceiver;
import group.sender.MessageSender;

import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String args[]) throws Exception {
        final Socket socket = new Socket("127.0.0.1", 55533);
        Scanner scanner = new Scanner(System.in);
        MessageSender sender = new MessageSender(socket);
        sender.sendMessage("hello,server");
        socket.shutdownOutput();
        MessageReceiver receiver = new MessageReceiver(socket);
        System.out.println("server: " + receiver.receiveMessage());
        sender.close();
        receiver.close();
    }
}